package org.example.bean.enums;

import lombok.Getter;

@Getter
public enum DataSource {

    /**
     * 拍机堂
     */
    DATA_ONE(0, "拍机堂"),
    /**
     * 拍拍代卖
     */
    DATA_TWO(1, "拍拍代卖"),

    DATA_JDX(2, "机大侠");

    private final Integer code;

    private final String description;

    DataSource(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    public static DataSource ofCode(Integer code) {
        for (DataSource type : DataSource.values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }
}
